package main

import (
	"encoding/json"
	"log"
)

// 从配置文件中载入json字符串
func LoadConfig(path string) map[string]interface{} {
	//buf, err := ioutil.ReadFile(path)
	buf, err := file_get_content(path)
	if err != nil {
		log.Panicln("load config conf failed: ", err)
	}
	var configs map[string]interface{}
	err = json.Unmarshal(buf, &configs)
	if err != nil {
		log.Panicln("decode config file failed:", string(buf), err)
	}
	return configs
}
